#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   NRC22_Fun_test.py
@Time    :   2024/08/16 13:31:28
@Author  :   YangLiang
@Version :   1.0
@Contact :   yangliang@chengtech.com
@License :   (C)Copyright 2022-2025
@Desc    :   None
'''

# here put the import lib
from pickle import TRUE
from pytest_assume.plugin import assume

import pytest
import logging
import time
import requests
from sympy import I
# from sympy import assuming
from commDriver.TS_CAN import *
import allure
import sys
from collections.abc import Iterable

from sqlalchemy import false
sys.dont_write_bytecode = True


CommunicationControl = [([0x28, 0x00, 0x01],[0x68],[0x68]),
                        ([0x28, 0x01, 0x01],[0x68],[0x68]),
                        ([0x28, 0x03, 0x01],[0x68],[0x68]),
                        ([0x28, 0x80, 0x01],[],[]),
                        ([0x28, 0x81, 0x01],[],[]),
                        ([0x28, 0x83, 0x01],[],[]),
                        ]


ControlDTCSetting = [   ([0x85, 0x01],[0xC5],[0xC5]),
                        ([0x85, 0x02],[0xC5],[0xC5]),
                        ([0x85, 0x81],[],[]),
                        ([0x85, 0x82],[],[]),
                        ]


@allure.severity('critical')
class Test_NoNRC22_Fun(object):
    '''Vehicle_speed lost or vehicle_speed invalid'''

    def SpeedInvalid(self, Driver, iStep, enable=False, invalidType = 'count'):
        ''' speed invalid Type 
            True:               speed invalid 
            False:              speed valid
            count:              speed count invalid
            stats:              speed status invalid
            checksum:           speed checksum invalid
            rolling_counter:    speed rolling counter invalid
            lost:               speed signal lost
        '''


        if enable:
            # 设置车速为80，等待信号被接收
            iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep) 
            time.sleep(0.3) 
            logging.info('Wait 300ms for signal to be received')

            # 车速信号失效状态选择
            if invalidType == 'count':
                # 车速无效
                iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',281.5,iStep)
            if invalidType == 'stats':
                # 车速状态无效
                iStep = Driver['CAN'].setSignalValue('IPB_0x10C','VehicleSpeed_Status',1,iStep)
            if invalidType == 'checksum':
                # 车身信号checksum错误
                Driver['CAN'].set_0x10C_checksum_error(True)
            if invalidType == 'rolling_counter':
                # 车身信号rolling counter错误
                Driver['CAN'].set_0x10C_rolling_counter_error(True)
            if invalidType == 'lost':
                # 车身信号停发
                iStep = Driver['CAN'].setSignalEanble('IPB_0x10C', False, 0.1, iStep)

            time.sleep(0.5)
            logging.info('Wait 300ms for signal to be invalidated')
        else:
            iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
            iStep = Driver['CAN'].setSignalValue('IPB_0x10C','VehicleSpeed_Status',0,iStep)
            Driver['CAN'].set_0x10C_checksum_error(False) 
            Driver['CAN'].set_0x10C_rolling_counter_error(False)  
            iStep = Driver['CAN'].setSignalEanble('IPB_0x10C', True, 0.1, iStep) 
        
        return iStep

    
    def GearInvalid(self, Driver, iStep, enable=False, invalidType = 'count'):
        ''' speed invalid Type 
            True:               speed invalid 
            False:              speed valid
            count:              speed count invalid
            stats:              speed status invalid
            checksum:           speed checksum invalid
            rolling_counter:    speed rolling counter invalid
            lost:               speed signal lost
        '''


        if enable:
            # 设置档位为D gear，等待信号被接收
            iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',4,iStep) 
            time.sleep(0.3) 
            logging.info('Wait 300ms')

            # 档位失效状态选择
            if invalidType == 'count':
                # 档位数值无效
                iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',9,iStep)
            if invalidType == 'checksum':
                # 档位信号checksum错误
                Driver['CAN'].set_0x05A_checksum_error(True)
            if invalidType == 'rolling_counter':
                # 档位信号rolling counter错误
                Driver['CAN'].set_0x05A_rolling_counter_error(True)
            if invalidType == 'lost':
                # 档位信号停发
                iStep = Driver['CAN'].setSignalEanble('VCU_0x05A', False, 0.1, iStep)

            time.sleep(0.3)
            logging.info('Wait 300ms')
        else:
            iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
            Driver['CAN'].set_0x05A_checksum_error(False) 
            Driver['CAN'].set_0x05A_rolling_counter_error(False)  
            iStep = Driver['CAN'].setSignalEanble('VCU_0x05A', True, 0.1, iStep) 
        
        return iStep


    

    '''--------------------------------------------------车速数值超出范围------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Count_Invalid')
    @allure.description('Test 0x28 Service Vspeed_Count_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Count_Invalid_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型数值超出范围
        iStep = self.SpeedInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'count')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Count_Invalid')
    @allure.description('Test 0x28 Service Vspeed_Count_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Count_Invalid_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型数值超出范围
        iStep = self.SpeedInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'count')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Count_Invalid')
    @allure.description('Test 0x85 Service Vspeed_Count_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Count_Invalid_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型数值超出范围
        iStep = self.SpeedInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'count')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Count_Invalid')
    @allure.description('Test 0x85 Service Vspeed_Count_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Count_Invalid_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型数值超出范围
        iStep = self.SpeedInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'count')


    '''--------------------------------------------------车速状态错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Stats_Invalid')
    @allure.description('Test 0x28 Service Vspeed_Stats_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Stats_Invalid_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速状态错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'stats')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'stats')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Stats_Invalid')
    @allure.description('Test 0x28 Service Vspeed_Stats_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Stats_Invalid_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速状态错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'stats')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'stats')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Stats_Invalid')
    @allure.description('Test 0x85 Service Vspeed_Stats_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Stats_Invalid_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速状态错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'stats')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'stats')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Stats_Invalid')
    @allure.description('Test 0x85 Service Vspeed_Stats_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Stats_Invalid_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速状态错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'stats')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'stats')
       

    '''--------------------------------------------------车速checksum错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_CheckSum_Invalid')
    @allure.description('Test 0x28 Service Vspeed_CheckSum_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_CheckSum_Invalid_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速checksum错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'CheckSum')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_CheckSum_Invalid')
    @allure.description('Test 0x28 Service Vspeed_CheckSum_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_CheckSum_Invalid_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速checksum错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'CheckSum')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_CheckSum_Invalid')
    @allure.description('Test 0x85 Service Vspeed_CheckSum_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_CheckSum_Invalid_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速checksum错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'CheckSum')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_CheckSum_Invalid')
    @allure.description('Test 0x85 Service Vspeed_CheckSum_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_CheckSum_Invalid_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速checksum错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'CheckSum')

    '''--------------------------------------------------车速rolling_counter错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_RollingCounter_Invalid')
    @allure.description('Test 0x28 Service Vspeed_RollingCounter_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_RollingCounter_Invalid_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速rolling_counter错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'rolling_counter')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_RollingCounter_Invalid')
    @allure.description('Test 0x28 Service Vspeed_RollingCounter_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_RollingCounter_Invalid_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速rolling_counter错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'rolling_counter')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_RollingCounter_Invalid')
    @allure.description('Test 0x85 Service Vspeed_RollingCounter_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_RollingCounter_Invalid_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速rolling_counter错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'rolling_counter')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_RollingCounter_Invalid')
    @allure.description('Test 0x85 Service Vspeed_RollingCounter_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_RollingCounter_Invalid_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速rolling_counter错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'rolling_counter')


    '''--------------------------------------------------车速信号停发------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Lost')
    @allure.description('Test 0x28 Service Vspeed_Lost response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Lost_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速信号停发
        iStep = self.SpeedInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'lost')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Lost')
    @allure.description('Test 0x28 Service Vspeed_Lost response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Lost_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速信号停发
        iStep = self.SpeedInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'lost')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Lost')
    @allure.description('Test 0x85 Service Vspeed_Lost response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Lost_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速信号停发
        iStep = self.SpeedInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'lost')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Lost')
    @allure.description('Test 0x85 Service Vspeed_Lost response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Lost_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速信号停发
        iStep = self.SpeedInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'lost')
    
    '''--------------------------------------------------档位数值超出范围------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_Count_Invalid')
    @allure.description('Test 0x28 Service Gear_Count_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_Count_Invalid_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型数值超出范围
        iStep = self.GearInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'count')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_Count_Invalid')
    @allure.description('Test 0x28 Service Gear_Count_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_Count_Invalid_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型数值超出范围
        iStep = self.GearInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'count')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_Count_Invalid')
    @allure.description('Test 0x85 Service Gear_Count_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_Count_Invalid_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型数值超出范围
        iStep = self.GearInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'count')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_Count_Invalid')
    @allure.description('Test 0x85 Service Gear_Count_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_Count_Invalid_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型数值超出范围
        iStep = self.GearInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'count')

    '''--------------------------------------------------档位checksum校验错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_checksum_Invalid')
    @allure.description('Test 0x28 Service Gear_checksum_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_CheckSum_Invalid_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型checksum错误
        iStep = self.GearInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'checksum')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_checksum_Invalid')
    @allure.description('Test 0x28 Service Gear_checksum_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_CheckSum_Invalid_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型checksum错误
        iStep = self.GearInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'checksum')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_checksum_Invalid')
    @allure.description('Test 0x85 Service Gear_checksum_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_CheckSum_Invalid_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型checksum错误
        iStep = self.GearInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'checksum')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_checksum_Invalid')
    @allure.description('Test 0x85 Service Gear_checksum_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_CheckSum_Invalid_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型checksum错误
        iStep = self.GearInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'checksum')

    '''--------------------------------------------------档位RollingCounter校验错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_RollingCounter_Invalid')
    @allure.description('Test 0x28 Service Gear_RollingCounter_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_RollingCounter_Invalid_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型roolling_counter错误
        iStep = self.GearInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'rolling_counter')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_RollingCounter_Invalid')
    @allure.description('Test 0x28 Service Gear_RollingCounter_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_RollingCounter_Invalid_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型roolling_counter错误
        iStep = self.GearInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'rolling_counter')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_RollingCounter_Invalid')
    @allure.description('Test 0x85 Service Gear_RollingCounter_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_RollingCounter_Invalid_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型roolling_counter错误
        iStep = self.GearInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'rolling_counter')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_RollingCounter_Invalid')
    @allure.description('Test 0x85 Service Gear_RollingCounter_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_RollingCounter_Invalid_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型roolling_counter错误        
        iStep = self.GearInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'rolling_counter')
    
    '''--------------------------------------------------档位信号丢失------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear Lost')
    @allure.description('Test 0x28 Service Gear Lost response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_Lost_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型信号丢失
        iStep = self.GearInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'lost')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear Lost')
    @allure.description('Test 0x28 Service Gear Lost response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_Lost_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型信号丢失
        iStep = self.GearInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'lost')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear Lost')
    @allure.description('Test 0x85 Service Gear Lost response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_Lost_Programming_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型信号丢失
        iStep = self.GearInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'lost')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear Lost')
    @allure.description('Test 0x85 Service Gear Lost response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_Lost_Extended_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型信号丢失
        iStep = self.GearInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'lost')


    

    '''----------------------------------------------------SEND 3E 80----------------------------------------------------'''



    '''--------------------------------------------------车速数值超出范围------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Count_Invalid')
    @allure.description('Test 0x28 Service Vspeed_Count_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Count_Invalid_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型数值超出范围
        iStep = self.SpeedInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'count')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Count_Invalid')
    @allure.description('Test 0x28 Service Vspeed_Count_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Count_Invalid_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型数值超出范围
        iStep = self.SpeedInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'count')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Count_Invalid')
    @allure.description('Test 0x85 Service Vspeed_Count_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Count_Invalid_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型数值超出范围
        iStep = self.SpeedInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'count')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Count_Invalid')
    @allure.description('Test 0x85 Service Vspeed_Count_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Count_Invalid_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型数值超出范围
        iStep = self.SpeedInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'count')


    '''--------------------------------------------------车速状态错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Stats_Invalid')
    @allure.description('Test 0x28 Service Vspeed_Stats_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Stats_Invalid_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速状态错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'stats')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'stats')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Stats_Invalid')
    @allure.description('Test 0x28 Service Vspeed_Stats_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Stats_Invalid_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速状态错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'stats')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'stats')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Stats_Invalid')
    @allure.description('Test 0x85 Service Vspeed_Stats_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Stats_Invalid_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速状态错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'stats')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'stats')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Stats_Invalid')
    @allure.description('Test 0x85 Service Vspeed_Stats_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Stats_Invalid_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速状态错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'stats')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'stats')
       

    '''--------------------------------------------------车速checksum错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_CheckSum_Invalid')
    @allure.description('Test 0x28 Service Vspeed_CheckSum_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_CheckSum_Invalid_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速checksum错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'CheckSum')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_CheckSum_Invalid')
    @allure.description('Test 0x28 Service Vspeed_CheckSum_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_CheckSum_Invalid_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速checksum错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'CheckSum')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_CheckSum_Invalid')
    @allure.description('Test 0x85 Service Vspeed_CheckSum_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_CheckSum_Invalid_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速checksum错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'CheckSum')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_CheckSum_Invalid')
    @allure.description('Test 0x85 Service Vspeed_CheckSum_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_CheckSum_Invalid_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速checksum错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'CheckSum')

    '''--------------------------------------------------车速rolling_counter错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_RollingCounter_Invalid')
    @allure.description('Test 0x28 Service Vspeed_RollingCounter_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_RollingCounter_Invalid_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速rolling_counter错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'rolling_counter')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_RollingCounter_Invalid')
    @allure.description('Test 0x28 Service Vspeed_RollingCounter_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_RollingCounter_Invalid_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速rolling_counter错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'rolling_counter')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_RollingCounter_Invalid')
    @allure.description('Test 0x85 Service Vspeed_RollingCounter_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_RollingCounter_Invalid_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速rolling_counter错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'rolling_counter')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_RollingCounter_Invalid')
    @allure.description('Test 0x85 Service Vspeed_RollingCounter_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_RollingCounter_Invalid_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速rolling_counter错误
        iStep = self.SpeedInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'rolling_counter')


    '''--------------------------------------------------车速信号停发------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Lost')
    @allure.description('Test 0x28 Service Vspeed_Lost response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Lost_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速信号停发
        iStep = self.SpeedInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'lost')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed_Lost')
    @allure.description('Test 0x28 Service Vspeed_Lost response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Vspeed_Lost_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速信号停发
        iStep = self.SpeedInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'lost')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Lost')
    @allure.description('Test 0x85 Service Vspeed_Lost response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Lost_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速信号停发
        iStep = self.SpeedInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'lost')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed_Lost')
    @allure.description('Test 0x85 Service Vspeed_Lost response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Vspeed_Lost_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置车速信号失效,失效类型车速信号停发
        iStep = self.SpeedInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.SpeedInvalid(Driver, iStep, False, 'lost')
    
    '''--------------------------------------------------档位数值超出范围------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_Count_Invalid')
    @allure.description('Test 0x28 Service Gear_Count_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_Count_Invalid_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型数值超出范围
        iStep = self.GearInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'count')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_Count_Invalid')
    @allure.description('Test 0x28 Service Gear_Count_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_Count_Invalid_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型数值超出范围
        iStep = self.GearInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'count')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_Count_Invalid')
    @allure.description('Test 0x85 Service Gear_Count_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_Count_Invalid_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型数值超出范围
        iStep = self.GearInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'count')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_Count_Invalid')
    @allure.description('Test 0x85 Service Gear_Count_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_Count_Invalid_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型数值超出范围
        iStep = self.GearInvalid(Driver, iStep, True, 'count')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'count')

    '''--------------------------------------------------档位checksum校验错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_checksum_Invalid')
    @allure.description('Test 0x28 Service Gear_checksum_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_CheckSum_Invalid_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型checksum错误
        iStep = self.GearInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'checksum')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_checksum_Invalid')
    @allure.description('Test 0x28 Service Gear_checksum_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_CheckSum_Invalid_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型checksum错误
        iStep = self.GearInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'checksum')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_checksum_Invalid')
    @allure.description('Test 0x85 Service Gear_checksum_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_CheckSum_Invalid_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型checksum错误
        iStep = self.GearInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'checksum')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_checksum_Invalid')
    @allure.description('Test 0x85 Service Gear_checksum_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_CheckSum_Invalid_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型checksum错误
        iStep = self.GearInvalid(Driver, iStep, True, 'checksum')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'checksum')

    '''--------------------------------------------------档位RollingCounter校验错误------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_RollingCounter_Invalid')
    @allure.description('Test 0x28 Service Gear_RollingCounter_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_RollingCounter_Invalid_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型roolling_counter错误
        iStep = self.GearInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'rolling_counter')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear_RollingCounter_Invalid')
    @allure.description('Test 0x28 Service Gear_RollingCounter_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_RollingCounter_Invalid_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型roolling_counter错误
        iStep = self.GearInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'rolling_counter')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_RollingCounter_Invalid')
    @allure.description('Test 0x85 Service Gear_RollingCounter_Invalid response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_RollingCounter_Invalid_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型roolling_counter错误
        iStep = self.GearInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'rolling_counter')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear_RollingCounter_Invalid')
    @allure.description('Test 0x85 Service Gear_RollingCounter_Invalid response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_RollingCounter_Invalid_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型roolling_counter错误        
        iStep = self.GearInvalid(Driver, iStep, True, 'rolling_counter')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'rolling_counter')
    
    '''--------------------------------------------------档位信号丢失------------------------------------------------'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear Lost')
    @allure.description('Test 0x28 Service Gear Lost response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_Lost_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型信号丢失
        iStep = self.GearInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'lost')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear Lost')
    @allure.description('Test 0x28 Service Gear Lost response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_Gear_Lost_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型信号丢失
        iStep = self.GearInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'lost')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear Lost')
    @allure.description('Test 0x85 Service Gear Lost response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_Lost_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False, 'UDSFun')
        #设置档位信号失效,失效类型信号丢失
        iStep = self.GearInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'lost')


    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear Lost')
    @allure.description('Test 0x85 Service Gear Lost response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_Gear_Lost_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, True, 'UDSFun')
        #设置档位信号失效,失效类型信号丢失
        iStep = self.GearInvalid(Driver, iStep, True, 'lost')
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False, 'UDSFun')
        iStep = self.GearInvalid(Driver, iStep, False, 'lost')